#include "Transform.h"
#include <stdlib.h>

Transform::Transform()
{
	this->m_X = 1.0f;
	this->m_Y = 1.0f;
	this->m_Z = 1.0f;
	this->m_Angle = 0.0f;
	this->m_isEmpty = true;
}
Transform::Transform(float X, float Y, float Z)
{
	this->m_X = X;
	this->m_Y = Y;
	this->m_Z = Z;
	this->m_Angle = 0.0f;
	this->m_isEmpty = true;
}
Transform::Transform(float X, float Y, float Z, float Angle)
{
	this->m_X = X;
	this->m_Y = Y;
	this->m_Z = Z;
	this->m_Angle = Angle;
	this->m_isEmpty = true;
}

void Transform::SetX(float X)
{
	this->m_X = X;
	this->m_isEmpty = false;
}

void Transform::SetY(float Y)
{
	this->m_Y = Y;
	this->m_isEmpty = false;
}

void Transform::SetZ(float Z)
{
	this->m_Z = Z;
	this->m_isEmpty = false;
}

void Transform::SetAngle(float angle)
{
	this->m_Angle = angle;
	this->m_isEmpty = false;
}

void Transform::SetXYZ(float X, float Y, float Z)
{
	SetX(X);
	SetY(Y);
	SetZ(Z);
}

void Transform::SetXYZA(float X, float Y, float Z, float angle)
{
	SetX(X);
	SetY(Y);
	SetZ(Z);
	SetAngle(angle);
}

void Transform::SetType(int type)
{
	this->m_Type = type;
}

float Transform::GetX()
{
	return this->m_X;
}

float Transform::GetY()
{
	return this->m_Y;
}

float Transform::GetZ()
{
	return this->m_Z;
}

float Transform::GetAngle()
{
	return this->m_Angle;
}

int Transform::GetType()
{
	return this->m_Type;
}

bool Transform::isEmpty()
{
	return this->m_isEmpty;
}

Transform& Transform::operator=(const Transform &rhs)
{
	this->m_X = rhs.m_X;
	this->m_Y = rhs.m_Y;
	this->m_Z = rhs.m_Z;
	this->m_Angle = rhs.m_Angle;

	return *this;
}

Transform& Transform::operator=(const int &rhs)
{
	if((this->m_isEmpty) && (rhs == NULL))
	{
		this->m_X = NULL;
		this->m_Y = NULL;
		this->m_Z = NULL;
		this->m_Angle = NULL;
	}

	return *this;
}

bool Transform::operator==(const int &other) const
{
	if((other == NULL) && (this->m_isEmpty == true))
		return true;
	else
		return false;
}
